home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML Instance.sea / XML Instance / Required / ccs_util.jar / test / framework / TestSuite.class (.txt) < prev   
Encoding:
Java Class File  |  1999-12-09  |  1.4 KB  |  38 lines

  1. package test.framework;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.Vector;
  5.  
  6. public class TestSuite implements Test {
  7.    private Vector fTests = new Vector(10);
  8.  
  9.    public void run(TestResult result) {
  10.       Enumeration e = this.fTests.elements();
  11.  
  12.       while(e.hasMoreElements() && !result.shouldStop()) {
  13.          Test test = (Test)e.nextElement();
  14.          test.run(result);
  15.       }
  16.  
  17.    }
  18.  
  19.    public void addTest(Test test) {
  20.       this.fTests.addElement(test);
  21.    }
  22.  
  23.    public int countTestCases() {
  24.       int count = 0;
  25.  
  26.       Test test;
  27.       for(Enumeration e = this.fTests.elements(); e.hasMoreElements(); count += test.countTestCases()) {
  28.          test = (Test)e.nextElement();
  29.       }
  30.  
  31.       return count;
  32.    }
  33.  
  34.    public String toString() {
  35.       return this.fTests.toString();
  36.    }
  37. }
  38.